package com.hmall.common.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;

/**
 * ，RequestInterceptor
 * 用于在发送 HTTP 请求之前对请求进行自定义处理，
 * 如添加请求头、修改URL参数等
 */
@Slf4j
public class MyFeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {

        log.info("===request: {}", template.url());
        template.header("authorization", "2");
    }
}